import java.util.Vector;

public class MyTank extends Tank{
    MyTank(int x,int y){
        super(x,y);
        this.setKind(1);
        this.setSpeed(10);
    }


    Vector<Bullet> bulletVector=new Vector();
    Bullet bullet = null;

    public void attack(){
        switch (this.getDir()){
            case 0:
                bullet = new Bullet(this.getX()+12,this.getY()-20,this.getDir());
                bulletVector.add(bullet);
                break;
            case 1:
                bullet = new Bullet(this.getX()+12,this.getY()+47,this.getDir());
                bulletVector.add(bullet);
                break;
            case 2:
                bullet = new Bullet(this.getX()-20,this.getY()+12,this.getDir());
                bulletVector.add(bullet);
                break;
            case 3:
                bullet = new Bullet(this.getX()+47,this.getY()+12,this.getDir());
                bulletVector.add(bullet);
                break;
        }
        Thread thread = new Thread(bullet);
        thread.start();
    }

}
